﻿using System;
using System.Web.UI;

namespace Components.Data.UI.Controls
{
  public static class ControlService
  {
    public static Control FindControl(Control control, String controlID)
    {
      if (control.ID == controlID)
        return control;

      foreach (Control childControl in control.Controls)
      {
        Control childControl2 = FindControl(childControl, controlID);
        if (childControl2 != null)
          return childControl2;
      }
      return null;
    }
  }
}